import request from '../utils/request'

/**
 * 获取用户信息
 * @token {*} token
 * @returns
 */

export function get_user_info(token: any) {
  return request({
    url: `/user/info/${token}/1`,
    method: 'get',
  })
}

export function user_logout(logincode: string | number) {
  return request({
    url: `/exit/${logincode}`,
    method: 'get',
  })
}

export function getMneu(data: any) {
  return request({
    url: `/role/getMenuList/${data}`,
    method: 'get',
  })
}

// 工作台权限
export function getChildren(rid: any) {
  return request({
    url: `/menu/get/childMenu/${rid}/1043`,
    method: 'get',
  })
}

export const getUserByGroupId = (gid: number) =>
  request({
    url: `/user/group/${gid}`,
    method: 'get',
  })

export const getUserListExceptMe = (pid: number | string) =>
  request(
    {
      url: `/user/exme/${pid}`,
      method: 'get',
    },
    true
  )

export const getUserByProjectId = (pid: number) =>
  request(
    {
      url: `/user/project/${pid}`,
      method: 'get',
    },
    true
  )
